home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / WXWINDEM.ZIP / HELLO.H < prev    next >
C/C++ Source or Header  |  1993-04-18  |  3KB  |  88 lines

  1. /*
  2.  * File:     hello.h
  3.  * Purpose:  Demo for wxWindows class library
  4.  *
  5.  *                       wxWindows 1.40
  6.  * Copyright (c) 1993 Artificial Intelligence Applications Institute,
  7.  *                   The University of Edinburgh
  8.  *
  9.  *                     Author: Julian Smart
  10.  *                        Date: 18-4-93
  11.  *
  12.  * Permission to use, copy, modify, and distribute this software and its
  13.  * documentation for any purpose is hereby granted without fee, provided
  14.  * that the above copyright notice, author statement and this permission
  15.  * notice appear in all copies of this software and related documentation.
  16.  *
  17.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, EXPRESS,
  18.  * IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
  19.  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  20.  *
  21.  * IN NO EVENT SHALL THE ARTIFICIAL INTELLIGENCE APPLICATIONS INSTITUTE OR THE
  22.  * UNIVERSITY OF EDINBURGH BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT OR
  23.  * CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER RESULTING FROM
  24.  * LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF THE POSSIBILITY OF
  25.  * DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH
  26.  * THE USE OR PERFORMANCE OF THIS SOFTWARE.
  27.  *
  28.  */
  29.  
  30. // Define a new application
  31. class MyApp: public wxApp
  32. {
  33.   public:
  34.     wxFrame *OnInit(void);
  35. };
  36.  
  37. // Define a new canvas which can receive some events
  38. class MyCanvas: public wxCanvas
  39. {
  40.   public:
  41.     MyCanvas(wxFrame *frame, int x, int y, int w, int h, int style = wxRETAINED);
  42.     void OnPaint(void);
  43.     void OnEvent(wxEvent& event);
  44.     void OnChar(int ch);
  45. };
  46.  
  47. // Define a new frame
  48. class MyFrame: public wxFrame
  49. {
  50.   public:
  51.     wxPanel *panel;
  52.     wxTextWindow *text_window;
  53.     MyCanvas *canvas;
  54.     MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h);
  55.     void OnSize(int w, int h);
  56.     Bool OnClose(void);
  57.     void OnMenuCommand(int id);
  58.     void OnMenuSelect(int id);
  59.     void Draw(wxDC& dc, Bool draw_bitmaps = TRUE);
  60. };
  61.  
  62. // Callbacks
  63. void button_proc(wxButton& but, wxEvent& event);
  64. void list_proc(wxListBox& list, wxEvent& event);
  65. void GenericOk(wxButton& but, wxEvent& event);
  66.  
  67. // Timer
  68. class MyTimer: public wxTimer
  69. {
  70.  public:
  71.   void Notify(void);
  72. };
  73.  
  74. #define HELLO_QUIT       100
  75. #define HELLO_PRINT      101
  76. #define HELLO_TWIPS      103
  77. #define HELLO_METRIC     104
  78. #define HELLO_LOMETRIC   105
  79. #define HELLO_NORMAL     106
  80. #define HELLO_ZOOM       107
  81. #define HELLO_ABOUT      108
  82. #define HELLO_TIMER_ON   109
  83. #define HELLO_TIMER_OFF  110
  84. #define HELLO_LOAD_FILE  111
  85. #define HELLO_PRINT_EPS  112  // Windows-only option
  86. #define HELLO_COPY_MF    113  // Windows-only option
  87. #define HELLO_SCALE      114
  88.